require(['./config'], function() {
	require(['jquery', 'loadHF'], function($) {
		class Register{
			constructor(){
				this.addListener()
			}
		
		addListener(){
			$('.login-btn').on('click',this.registerHandler)
		}
		registerHandler(e){
			e.preventDefault()
			const data=$('.login-form').serialize();
			console.log(data)
			$.post('/api/register.php',data,(res)=>{
				if (res.data.status === 1) { // 注册成功
						location = '/html/login.html'
					} else { // 注册失败
						$('.register-error').removeClass('hidden').text(res.data.message)
					}
				
			},'json')
			
			
			
			
		}
	
	
	
	}
		new Register()
	})
})